﻿
namespace ATA.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.ChuongTrinh"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ChuongTrinhEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ChuongTrinhId property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxChuongTrinhId;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ChuongTrinhId property.
		/// </summary>
		protected System.Windows.Forms.Label uxChuongTrinhIdLabel;
		
		/// <summary>
		/// TextBox for the TenChuongTrinh property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxTenChuongTrinh;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the TenChuongTrinh property.
		/// </summary>
		protected System.Windows.Forms.Label uxTenChuongTrinhLabel;
		
		/// <summary>
		/// CheckBox for the IsActive property.
		/// </summary>
		protected System.Windows.Forms.CheckBox uxIsActive;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IsActive property.
		/// </summary>
		protected System.Windows.Forms.Label uxIsActiveLabel;
		
		/// <summary>
		/// DataTimePicker for the LastUpdate property.
		/// </summary>
		protected System.Windows.Forms.DateTimePicker uxLastUpdate;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the LastUpdate property.
		/// </summary>
		protected System.Windows.Forms.Label uxLastUpdateLabel;
		
		/// <summary>
		/// TextBox for the UpdateBy property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxUpdateBy;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the UpdateBy property.
		/// </summary>
		protected System.Windows.Forms.Label uxUpdateByLabel;
		#endregion
		
		#region Main entity
		private Entities.ChuongTrinh _ChuongTrinh;
		/// <summary>
		/// Gets or sets the <see cref="Entities.ChuongTrinh"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.ChuongTrinh"/> instance.</value>
		public Entities.ChuongTrinh ChuongTrinh
		{
			get {return this._ChuongTrinh;}
			set
			{
				this._ChuongTrinh = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxChuongTrinhId.DataBindings.Clear();
			this.uxChuongTrinhId.DataBindings.Add("Text", this.uxBindingSource, "ChuongTrinhId", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxTenChuongTrinh.DataBindings.Clear();
			this.uxTenChuongTrinh.DataBindings.Add("Text", this.uxBindingSource, "TenChuongTrinh", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIsActive.DataBindings.Clear();
			this.uxIsActive.DataBindings.Add("Checked", this.uxBindingSource, "IsActive", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxLastUpdate.DataBindings.Clear();
			this.uxLastUpdate.DataBindings.Add("Value", this.uxBindingSource, "LastUpdate", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxUpdateBy.DataBindings.Clear();
			this.uxUpdateBy.DataBindings.Add("Text", this.uxBindingSource, "UpdateBy", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="ChuongTrinhEditControlBase"/> class.
		/// </summary>
		public ChuongTrinhEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_ChuongTrinh != null) _ChuongTrinh.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxChuongTrinhId = new System.Windows.Forms.TextBox();
			uxChuongTrinhIdLabel = new System.Windows.Forms.Label();
			this.uxTenChuongTrinh = new System.Windows.Forms.TextBox();
			uxTenChuongTrinhLabel = new System.Windows.Forms.Label();
			this.uxIsActive = new System.Windows.Forms.CheckBox();
			uxIsActiveLabel = new System.Windows.Forms.Label();
			this.uxLastUpdate = new System.Windows.Forms.DateTimePicker();
			uxLastUpdateLabel = new System.Windows.Forms.Label();
			this.uxUpdateBy = new System.Windows.Forms.TextBox();
			uxUpdateByLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxChuongTrinhIdLabel
			//
			this.uxChuongTrinhIdLabel.Text = "ChuongTrinhId:";
			this.uxChuongTrinhIdLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxChuongTrinhIdLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxChuongTrinhIdLabel);			
			//
			// uxChuongTrinhId
			//
			this.uxChuongTrinhId.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxChuongTrinhId);
			this.uxChuongTrinhId.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxChuongTrinhId);
			//
			// uxTenChuongTrinhLabel
			//
			this.uxTenChuongTrinhLabel.Text = "TenChuongTrinh:";
			this.uxTenChuongTrinhLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxTenChuongTrinhLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxTenChuongTrinhLabel);			
			//
			// uxTenChuongTrinh
			//
			this.uxTenChuongTrinh.Width = 250;
			this.uxTenChuongTrinh.MaxLength = 150;
			//this.uxTableLayoutPanel.Controls.Add(this.uxTenChuongTrinh);
			this.uxTenChuongTrinh.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxTenChuongTrinh);
			//
			// uxIsActiveLabel
			//
			this.uxIsActiveLabel.Text = "IsActive:";
			this.uxIsActiveLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxIsActiveLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIsActiveLabel);			
			//
			// uxIsActive
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIsActive);
			this.uxIsActive.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxIsActive);
			//
			// uxLastUpdateLabel
			//
			this.uxLastUpdateLabel.Text = "LastUpdate:";
			this.uxLastUpdateLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxLastUpdateLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxLastUpdateLabel);			
			//
			// uxLastUpdate
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxLastUpdate);
			this.uxLastUpdate.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxLastUpdate);
			//
			// uxUpdateByLabel
			//
			this.uxUpdateByLabel.Text = "UpdateBy:";
			this.uxUpdateByLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxUpdateByLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxUpdateByLabel);			
			//
			// uxUpdateBy
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxUpdateBy);
			this.uxUpdateBy.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxUpdateBy);
			// 
			// ChuongTrinhEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "ChuongTrinhEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
